// EcoModeler - C# Edition :: Version 9.16 build 3301
using System;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using Eco.Services;
using Eco.ObjectRepresentation;
using Eco.ObjectImplementation;
using Eco.UmlRt;
using Eco.UmlCodeAttributes;
using Eco.Subscription;

namespace TTServer
{
	#region MM_ECO_Generated
	#region Attributes
	[UmlElement(Id="{096c370c-beb9-4756-ac1f-a6c0a840cb01}")]
	#endregion

	#region Documentation
	//1 Spieler oder Doppel im Spielsystem
	/// Spieler oder Doppel im Spielsystem
	#endregion

	#endregion
	public class SpielerDoppel: object, ILoopBack
	{
		#region MM_ECO AutoGenerated ECO code

		protected IContent eco_Content;

		IObject IObjectProvider.AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public IObjectInstance AsIObject()
		{
			return this.eco_Content.AsIObject();
		}

		public struct Eco_LoopbackIndices
		{
			public const int Eco_FirstMember = 0;
			public const int Eco_MemberCount = (Eco_FirstMember + 4);
			public const int Nummer_MemberIndex = Eco_FirstMember + 0;
			public const int Spieler_MemberIndex = Eco_FirstMember + 1;
			public const int SSBegegnungAuswaerts_MemberIndex = Eco_FirstMember + 2;
			public const int SSBegegnungHeim_MemberIndex = Eco_FirstMember + 3;
		}

		public virtual object get_MemberByIndex(int index)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		public virtual void set_MemberByIndex(int index, object value)
		{
			switch (index)
			{
				default: throw new System.IndexOutOfRangeException();
			}
		}

		protected void Initialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content == null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				this.eco_Content = factory.CreateContent(this);
				this.eco_Content.LoopbackValid();
			}
		}

		protected void Deinitialize(IEcoServiceProvider serviceProvider)
		{
			if ((this.eco_Content != null))
			{
				IInternalObjectContentFactory factory = ((IInternalObjectContentFactory)(serviceProvider.GetEcoService(typeof(IInternalObjectContentFactory))));
				factory.CreateContentFailed(this.eco_Content, this);
				this.eco_Content = null;
			}
		}
		#endregion

		#region MM_ECO Model owned attributes
		//Note: Do not remove any property within this region, nor change its signature

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(SpielerDoppel.Eco_LoopbackIndices.Nummer_MemberIndex), Id="{aa44be0c-da9c-4e84-b4ad-f45e6bc0bdb4}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Nummer des Spielers oder des Doppels
		/// Nummer des Spielers oder des Doppels
		#endregion

		#endregion
		public int Nummer
		{
			get
			{
				#region MM_ECO_Generated
				return (int) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Nummer_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Nummer_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		#region Attributes
		[UmlElement(Index=(SpielerDoppel.Eco_LoopbackIndices.Spieler_MemberIndex), Id="{37b0a228-1288-407b-bbdc-1421193501f9}")]
		[UmlTaggedValue("Eco.Length", "255")]
		#endregion

		#region Documentation
		//1 Spieler oder Doppel
		/// Spieler oder Doppel
		#endregion

		#endregion
		public bool Spieler
		{
			get
			{
				#region MM_ECO_Generated
				return (bool) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.Spieler_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.Spieler_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(SpielerDoppel.Eco_LoopbackIndices.SSBegegnungAuswaerts_MemberIndex), Id="{e89f8523-8de0-4ca2-a4bd-ccb4d8cb05e2}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SSBegegnungSpielerDoppel1), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..1")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public TTServer.SpielsystemBegegnung SSBegegnungAuswaerts
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.SpielsystemBegegnung) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.SSBegegnungAuswaerts_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.SSBegegnungAuswaerts_MemberIndex, ((object)(value)));
				#endregion
			}
		}

		#region MM_ECO_Generated
		[UmlElement("AssociationEnd", Index=(SpielerDoppel.Eco_LoopbackIndices.SSBegegnungHeim_MemberIndex), Id="{29263f75-f7b8-4275-a300-72713d06da18}")]
		[UmlMetaAttribute("association", typeof(TTServerPackage.SSBegegnungSpielerDoppel), Index=0)]
		[UmlMetaAttribute("multiplicity", "0..1")]
		[UmlTaggedValue("Eco.Embed", "False")]
		#endregion
		public TTServer.SpielsystemBegegnung SSBegegnungHeim
		{
			get
			{
				#region MM_ECO_Generated
				return (TTServer.SpielsystemBegegnung) (this.eco_Content.get_MemberByIndex(Eco_LoopbackIndices.SSBegegnungHeim_MemberIndex));
				#endregion
			}
			set
			{
				#region MM_ECO_Generated
				this.eco_Content.set_MemberByIndex(Eco_LoopbackIndices.SSBegegnungHeim_MemberIndex, ((object)(value)));
				#endregion
			}
		}
		#endregion

		#region MM_ECO Model owned methods
		//Note: Do not remove any method within this region, nor change its signature

		public SpielerDoppel(IContent content)
		{
			#region MM_ECO_Generated
			this.eco_Content = content;
			content.AssertLoopbackUnassigned();
			#endregion
		}

		public SpielerDoppel(IEcoServiceProvider serviceProvider)
		{
			this.Initialize(serviceProvider);
			try
			{
				// Place user code ONLY here
			}
			catch (System.Exception)
			{
				this.Deinitialize(serviceProvider);
				throw;
			}
		}
		#endregion
	}
}
